import request from '@/utils/request'

// 查询合同列表
export function listContract (query) {
  return request({
    url: '/system/contract/list',
    method: 'get',
    params: query
  })
}
export function downloadContract(filePath) {
  return request({
    url: filePath, // 这里是文件的 URL
    method: 'get',
    responseType: 'blob', // 设置响应类型为 blob
  });
}
// 查询合同详细
export function getContract (contractId) {
  return request({
    url: '/system/contract/' + contractId,
    method: 'get'
  })
}

// 新增合同
export function addContract (data) {
  return request({
    url: '/system/contract',
    method: 'post',
    data: data
  })
}

// 修改合同
export function updateContract (data) {
  return request({
    url: '/system/contract',
    method: 'put',
    data: data
  })
}

export function uploadContract (data) {
  return request({
    url: '/common/upload',
    method: 'post',
    data: data
  })
}

// 删除合同
export function delContract (contractId) {
  return request({
    url: '/system/contract/' + contractId,
    method: 'delete'
  })
}
export function sendQyWxMsg (data) {
  return request({
    url: '/system/contract/sendQyWxMsg/',
    method: 'post',
    data: data
  })
}
export function queryContractStatusCounts () {
  return request({
    url: '/system/contract/queryContractStatusCounts',
    method: 'get'
  })
}
